<template>
    <div>
      <h2>名字：{{ name }}</h2>
      <h2>年龄：{{ age }}</h2>
      <input type="text">
      <button @click="showPerson">点我展示人员信息</button>
    </div>
</template>

<script>
   export default {
    name: "Person",
    data() {
      return {
        name: "tony",
        age: 18,
      }
    },
    methods: {
      showPerson() {
        console.log(this);
        alert(`我叫${this.name}，今天我${this.age}岁了`);
      },
    },
  };
</script>

<style>
  .person {
    width: 400px;
    height: 300px;
    background-color: skyblue;
    padding: 10px;
  }
</style>